/**
 * elancom Corporation copy right 2012 - 2015  
 *   
 * $Header: https://192.168.1.224/svn/elancom/product/elancom-platform/trunk/src/main/java/com/elancom/framework/commons/json/parser/deserializer/MapResolveFieldDeserializer.java 1034 2012-07-02 03:09:12Z lanzhouxue $
 * $Id: MapResolveFieldDeserializer.java 1034 2012-07-02 03:09:12Z lanzhouxue $
 * $Author: lanzhouxue $
 * $Date: 2012-07-02 11:09:12 +0800 (Mon, 02 Jul 2012) $
 * $Revision: 1034 $
 */
package com.elancom.framework.commons.json.parser.deserializer;

import java.lang.reflect.Type;
import java.util.Map;

import com.elancom.framework.commons.json.parser.DefaultJSONParser;

@SuppressWarnings("rawtypes")
public final class MapResolveFieldDeserializer extends FieldDeserializer {

	private final String key;
	private final Map map;

	public MapResolveFieldDeserializer(Map map, String index) {
		super(null, null);
		key = index;
		this.map = map;
	}

	@Override
	@SuppressWarnings("unchecked")
	public void setValue(Object object, Object value) {
		map.put(key, value);
	}

	@Override
	public void parseField(DefaultJSONParser parser, Object object, Type objectType, Map<String, Object> fieldValues) {

	}

	@Override
	public int getFastMatchToken() {
		return 0;
	}
}
